#!/bin/bash

gpu=0
dataset_dir='./data'
# dataset=CIFAR100 #DVS128Gesture
## static datasets: CIFAR10, CIFAR100, SVHN, Tiny-ImageNet-200
## neuromorphic datasets: CIFAR10DVS, DVS128Gesture

searchString="DVS"
for dataset in CIFAR10 CIFAR100 SVHN CIFAR10DVS DVS128Gesture Tiny-ImageNet-200
do

isDVS=$(echo $dataset | grep "${searchString}")

if [[ "$isDVS" != "" ]] 
then
    echo "$dataset is DVS dataset"
    T=20
    channels=16
    batch_size=64
else
    echo "$dataset is not DVS dataset"
    T=8 #20
    channels=64 #16
    batch_size=96 #64
fi
## Macro architecture types that we used in this study are included in space.py (see MACRO_SEARCH_SPACE)
macro_type=AutoSNN_$channels
suffix='_ACC_pow_spikes_8_99_1'

for search_mode in random evolution
do
## Various architectures searched by AutoSNN are included in search_arch/arch.py 
#arch=AutoSNN
# arch=AutoSNN_16_CIFAR10_SNN_2022_evolution_ACC_pow_spikes_8_99_1
arch=$macro_type'_'$dataset'_SNN_2022_'$search_mode$suffix
save=$macro_type'_'$dataset'_'$search_mode

python retrain/train.py \
    --gpu $gpu \
    --T $T --init_tau 2.0 --v_threshold 1.0 --neuron PLIF \
    --epochs 600 \
    --dataset_dir $dataset_dir \
    --dataset_name $dataset \
    --save $save \
    --arch $arch \
    --macro_type $macro_type \
    --seed 2022 \
    --batch_size $batch_size

done
done